#include <bits/stdc++.h>
//#define int long long
using namespace std;
const int N=1e5+5;
int n,arr[N];
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);


    cin>>n;
    for(int i=1,l;i<=n;i++)
    {
        cin>>l;
        arr[l]++;
    }
    int ans=0,sum=0;
    for(int i=N;i>=1;i--)
     {
         if(arr[i]==0)  continue;

         if(sum>=arr[i])
         {
             ans+=arr[i];
             sum-=arr[i];
         }
         else
         {
             ans+=sum;
             sum=0;
         }
         sum+=arr[i];
     }
     cout<<n-ans;
    fclose(stdin);
    fclose(stdout);
    return 0;
}
